<script setup>
import BusinessCard from "@/components/business-card/BusinessCard.vue";
import {ref} from 'vue'
import api from '@/api/index.js'

const goBusinessDetailClick = () => {
  console.log('点击商家')
}

const data = ref([])
const loading = ref(false)

const getList = () => {
  const params = {
    kindId: 0, // 0票务、1商超
    pageNum: 1,
    pageSize: 1,
  }
  loading.value = true
  api.getScenicHighQualityMerchants(params).then((res) => {
    data.value = res.data?.list ?? []
  }).finally(() => {
    loading.value = false
  })
}
getList()


</script>

<template>
  <div class="business">
    <div class="header">
      <div>
        <h3>优质商家</h3>
        <div class="line"></div>
      </div>
      <span class="fz12">更多 ></span>
    </div>
    <BusinessCard :data="data[0]" :loading="loading" />
  </div>

</template>

<style scoped lang="scss">
.van-skeleton {
  padding: 0;
}

.business {
  //margin-top: 1rem;
  margin-top: 6rem;
  margin-bottom: 2.4rem;
  padding: 0 1.5rem;
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.6rem;
    height: 2.5rem;
    h3 {
      font-size: 1.8rem;
      color: #333333;
      font-weight: bold;
    }
    .line{
      width:3rem;
      height: .5rem;
      background: linear-gradient(90deg, var(--van-primary-color) 0%, #FBEAA8 92%);
    }

    span {
      color: #999999;
    }
  }
}

</style>